feat(seer): Add Seer project connected repo endpoint#115199
Conversation
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.62% |
|
@sentry review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e93fc6. Configure here.
| branchName: str | ||
|
|
||
|
|
||
| class ProjectRepoResponse(TypedDict): |
There was a problem hiding this comment.
This matches the current SeerRepoDefinition built in the read path via build_repo_definition_from_project_repo.
Relates to CW-1286 Adds a Seer project single-repo endpoint **`ProjectSeerRepoEndpoint`** (`GET`/`PUT`/`DELETE`) with ProjectPermission. - **GET**: Returns the Seer project repo config (branch name, instructions, branch overrides) for a given repository. 404 if not connected, inactive, or unsupported provider. - **PUT**: Partial update — only updates fields present in the request body. Uses `select_for_update` on the SeerProjectRepository row. Replaces branch overrides if provided; preserves them if omitted. 404 if not found. - **DELETE**: Removes the Seer project repo. Branch overrides cascade-delete. 404 if not found. All three methods filter by supported SCM providers (`get_supported_scm_providers`), so repos with unsupported providers return 404. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Fixes CW-1286 Depends on #115199 and #115904 Adds a bulk Seer project repos endpoint **`ProjectSeerReposEndpoint`** (`GET`/`POST`/`PUT`) at `/api/0/projects/{org}/{project}/seer/repos/` with `ProjectPermission`. ### GET — List connected repos Lists all connected Seer project repos for a project. Supports search by `name` (substring, case-insensitive) and `provider` (exact match, supports `=`, `!=`, `IN`, `NOT IN`, with or without `integrations:` prefix), sorting by `name`/`-name`/`provider`/`-provider`, and offset pagination. Excludes inactive repos and unsupported providers. ``` GET /api/0/projects/my-org/my-project/seer/repos/?query=relay&sortBy=-name ``` ### POST — Add repos Upserts repos by ID. Validates all repo IDs are active, belong to the org, and have supported providers — returns 400 with invalid IDs if not. Rejects empty lists, duplicate repo IDs, and duplicate branch overrides. ``` POST /api/0/projects/my-org/my-project/seer/repos/ { "repos": [ {"repositoryId": 1, "branchName": "main", "instructions": "use pytest"}, {"repositoryId": 2, "branchOverrides": [ {"tagName": "environment", "tagValue": "production", "branchName": "release"} ]} ] } ``` ### PUT — Replace all repos Replaces all connected repos for the project atomically. Accepts an empty list to disconnect all repos. Same validation as POST for non-empty lists. ``` PUT /api/0/projects/my-org/my-project/seer/repos/ { "repos": [ {"repositoryId": 3, "branchName": "develop"} ] } ``` --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>

Relates to CW-1286
Adds a Seer project single-repo endpoint
ProjectSeerRepoEndpoint(GET/PUT/DELETE) with ProjectPermission.select_for_updateon the SeerProjectRepository row. Replaces branch overrides if provided; preserves them if omitted. 404 if not found.All three methods filter by supported SCM providers (
get_supported_scm_providers), so repos with unsupported providers return 404.